<template>
	<view>
		<view class="pg-30">
			<text>身份/市/区</text>
			<picker @change="bindPickerChange" mode = 'region'>
				<view class="btn px-30 d-flex-yCenter-sb mt-20">
					<text>{{actveText}}</text>
					<u-icon name="arrow-down" color="#000" size="28"></u-icon>
				</view>
			</picker>
		</view>
		<navigator hover-class="none" :url="'/goodsPackage/cmGoodsDter/cmGoodsDter?id='+item.id" class="mx-30 py-20 border-b " v-for="(item,index) in data" :key='index'>
			<text class="font-30 font-w">{{item.title}}</text>
			<view  class="d-flex flex-d itemadd mt-10">
				<text>{{item.province}}{{item.city}}{{item.district}}{{item.address}}</text>
				<!-- <text>营业时间：周一-周日 10:00-22:00</text> -->
				<text>联系电话：{{item.phone}}</text>
			</view>
		</navigator>
	</view>
</template>

<script>
	import {http_mall_suppliers_lst} from '@/config/apiRouter.js'
	export default {
		data() {
			return {
				actveText:'请选择城市',
				page:1,
				laz_page:0,
				addLIst:[],
				data:[]
			}
		},
		onLoad() {
			this.getData()
		},
		methods: {
			// 省市区选择
			bindPickerChange(e){
				let data=e.detail.value
				this.addLIst=data
				this.actveText=data.join('/')
				this.page=1
				this.getData()
			},
			getData(type){
				let list=this.addLIst
				let data={
					limit:10,
					page:this.page,
					province:list[0],
					city:list[1],
					district:list[2],
				}
				http_mall_suppliers_lst({
					data
				}).then(res=>{
					this.laz_page=res.data.last_page
					type?this.data=this.data.concat(res.data.data):this.data=res.data.data
				})
			}
		},
		onReachBottom() {
			if(this.page==this.laz_page || this.laz_page==0)return
			this.page++
			this.getData(true)
		}
	}
</script>

<style lang="scss">
	.btn {
		line-height: 70rpx;
		background: #FFFFFF;
		border: 1px solid #828282;
		border-radius: 8rpx;
	}
	.itemadd{
		font-size: 24rpx; color: #333;
		text{
			line-height: 2;
		}
	}
</style>
